package GUILayer;


import ControlLayer.CtrCustomer;
import ControlLayer.CtrEmployee;
import ControlLayer.CtrSupplier;
import ModelLayer.Customer;
import ModelLayer.Employee;
import ModelLayer.Product;
import ModelLayer.Supplier;
import javax.swing.UIManager.*;
import java.util.Date;
import ControlLayer.CtrSale;
import ControlLayer.CtrSalesLine;
import ControlLayer.CtrProduct;
import ControlLayer.CtrReservation;
import ModelLayer.Reservation;
import ModelLayer.ReservationRelation;
import ModelLayer.Sale;
import ModelLayer.SalesLine;
import java.util.ArrayList;
import javax.swing.*;



/**
 *
 * @author R3l4X
 */
public class MainGUI extends javax.swing.JFrame {
    private static final long serialVersionUID = 5480967402200429721L;
    
    private OpretKundeGUI opretKunde;
    private OpretProdukt opretProdukt;
    private OpretLeverandor opretLever;
    private OpretMedarbejder    opretMedarb;
    private AlleKunderGUI allekunder;
    private AlleLeverandor allelever;
    private AlleMedarbejder alleMedarb;
    private AlleProdukter   alleProd;
    private CtrSale ctrSale;
    private CtrSalesLine ctrSalesLine;
    private CtrEmployee ctrEmployee;
    private CtrProduct ctrProduct;
    private FindReservation findReser;
    private AlleReservationer alleReser;
    private ArrayList<SalesLine> listSalesLine; 
    private DefaultListModel<String> listModel;
    private CtrCustomer ctrCustomer;
    private FindSalg alleSalg;
    private CtrReservation ctrResev;

    /** Creates new form MainGUI */
    public MainGUI() {
        initComponents();
        this.setVisible(true);
        listSalesLine = new ArrayList<SalesLine>();
        ctrSale = new CtrSale();
        ctrSalesLine = new CtrSalesLine();
        ctrProduct = new CtrProduct();
        ctrEmployee = new CtrEmployee();
        ctrCustomer = new CtrCustomer();
        
        lblBasketTotal.setText("0.0");
        
        listModel = new DefaultListModel<String>();
        lstBasket.setModel(listModel);

        
        lblantalKunder.setText(String.valueOf(ctrCustomer.getAllKundeNum()));
        lblAntalProdukter.setText(String.valueOf(ctrProduct.getAllProductsNum()));
        jLabel34.setText(String.valueOf(ctrEmployee.getAllMedarbejderNum()));
        
   
        
    }     
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        ApplicationPane = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        jLabel35 = new javax.swing.JLabel();
        jLabelBillede = new javax.swing.JLabel();
        lblantalKunder = new javax.swing.JLabel();
        lblAntalProdukter = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        jLabel36 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        jLabel38 = new javax.swing.JLabel();
        jLabel39 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        SalgPanel = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        txtSalgOpretKundeID = new javax.swing.JTextField();
        btnSalgFindSalg = new javax.swing.JButton();
        txtBasketProductID = new javax.swing.JTextField();
        jLabel28 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        txtBasketAmount = new javax.swing.JTextField();
        jScrollPane2 = new javax.swing.JScrollPane();
        lstBasket = new javax.swing.JList();
        btnBasketRemove = new javax.swing.JButton();
        btnBasketAdd = new javax.swing.JButton();
        btnSalgOpret = new javax.swing.JButton();
        lblSalgOpretResultat = new javax.swing.JLabel();
        lblBasketTotal = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        radioBetaltOK = new javax.swing.JRadioButton();
        radioBetaltNEJ = new javax.swing.JRadioButton();
        ReservationPanel = new javax.swing.JPanel();
        btnReservationOpret = new javax.swing.JButton();
        btnReservationVisAlleReservationer = new javax.swing.JButton();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        txtReservationOpretMedarbejderID = new javax.swing.JTextField();
        txtReservationOpretKundeID = new javax.swing.JTextField();
        txtReservationOpretDato = new javax.swing.JTextField();
        txtReservationOpretPeriode = new javax.swing.JTextField();
        lblReserrvationStatus = new javax.swing.JLabel();
        btnReservationVisAlleReservationer1 = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTextArea1 = new javax.swing.JTextArea();
        KundePanel = new javax.swing.JPanel();
        txtKundeID = new javax.swing.JTextField();
        txtKundeUpdateNavn = new javax.swing.JTextField();
        txtKundeUpdateAdress = new javax.swing.JTextField();
        txtKundeUpdatePostNr = new javax.swing.JTextField();
        txtKundeUpdateCity = new javax.swing.JTextField();
        btnKundeUpdate = new javax.swing.JButton();
        btnKundeDelete = new javax.swing.JButton();
        UpdateKundeIDLabel = new javax.swing.JLabel();
        UpdateKundeNavnLabel = new javax.swing.JLabel();
        UpdateKundeAdresseLabel = new javax.swing.JLabel();
        UpdateKundePostNrCityLabel = new javax.swing.JLabel();
        UpdateKundePhoneNoLabel = new javax.swing.JLabel();
        txtKundeUpdatePhone = new javax.swing.JTextField();
        UpdateKundeEmailLabel = new javax.swing.JLabel();
        txtKundeUpdateEmail = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        txtKundeUpdateRabat = new javax.swing.JTextField();
        txtKundeUpdateEfterNavn = new javax.swing.JTextField();
        btnKundeOpretNy = new javax.swing.JButton();
        btnKundeHentID = new javax.swing.JButton();
        btnKundeAlleKunder = new javax.swing.JButton();
        jLabel31 = new javax.swing.JLabel();
        ProduktPanel = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        txtProduktID = new javax.swing.JTextField();
        txtProduktUpdateType = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        txtproduktUpdateDimensioner = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        txtProduktUpdatePris = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        txtProduktUpdatePlacering = new javax.swing.JTextField();
        btnProduktOpret = new javax.swing.JButton();
        btnProduktUpdate = new javax.swing.JButton();
        btnProduktAlleVarer = new javax.swing.JButton();
        txtProduktUpdateMax = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        txtProduktUpdateMin = new javax.swing.JTextField();
        txtProduktUpdateAntalLager = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        lblKundeLeverandorInfo = new javax.swing.JLabel();
        btnProduktSlet = new javax.swing.JButton();
        jLabel30 = new javax.swing.JLabel();
        lblKundeLeverandorInfo2 = new javax.swing.JLabel();
        jButton5 = new javax.swing.JButton();
        LeverandorPanel = new javax.swing.JPanel();
        jLabel13 = new javax.swing.JLabel();
        btnLevernandorOpretNy = new javax.swing.JButton();
        btnLeverandorUpdate = new javax.swing.JButton();
        btnLeverandorDelete = new javax.swing.JButton();
        btnLeverandorAlleLev = new javax.swing.JButton();
        txtLeverandorUpdateNavn = new javax.swing.JTextField();
        txtLeverandorUpdateAdresse = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        btnLeverandorHentID = new javax.swing.JButton();
        txtLeverandorUpdateID = new javax.swing.JTextField();
        txtLeverandorUpdatePhone = new javax.swing.JTextField();
        jLabel32 = new javax.swing.JLabel();
        MedarbejderPanel = new javax.swing.JPanel();
        jLabel18 = new javax.swing.JLabel();
        txtMedarbejderUpdateID = new javax.swing.JTextField();
        jLabel19 = new javax.swing.JLabel();
        txtMedarbejderUpdateNavn = new javax.swing.JTextField();
        txtMedarbejderUpdateAdresse = new javax.swing.JTextField();
        txtMedarbejderUpdateLon = new javax.swing.JTextField();
        txtMedarbejderUpdateAnsat = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        btnMedarbejderHentID = new javax.swing.JButton();
        btnMedarbejderTilfoj = new javax.swing.JButton();
        btnMedarbejderUpdate = new javax.swing.JButton();
        btnMedarbejderAlleMedarbejder = new javax.swing.JButton();
        lblMedarbejder = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Job Mobil Sav A/S");
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        ApplicationPane.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        ApplicationPane.setPreferredSize(new java.awt.Dimension(437, 382));

        jPanel1.setPreferredSize(new java.awt.Dimension(435, 326));

        jLabel12.setText("Antal Kunder :");

        jLabel35.setText("Antal Produkter : ");

        jLabelBillede.setIcon(new javax.swing.ImageIcon(getClass().getResource("/GUILayer/Untitled.png"))); // NOI18N
        jLabelBillede.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/GUILayer/Untitled.png"))); // NOI18N

        lblantalKunder.setText("test");

        lblAntalProdukter.setText("test");

        jLabel17.setText("Antal Medarbejder : ");

        jLabel34.setText("test");

        jLabel36.setText("JobsMobilSav");
        jLabel36.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabel36MouseClicked(evt);
            }
        });

        jLabel37.setText("Toftholmvej 9, V. Thorup");

        jLabel38.setText("9690 Fjerritslev");

        jLabel39.setText("20 37 28 59");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(45, 45, 45)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(jLabelBillede)
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addComponent(jLabel12)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(lblantalKunder)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel35)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(lblAntalProdukter)
                                    .addGap(19, 19, 19)))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel17)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel36)
                                    .addComponent(jLabel34)))))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(128, 128, 128)
                        .addComponent(jLabel37)))
                .addGap(38, 38, 38))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(68, 68, 68)
                .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 206, Short.MAX_VALUE)
                .addGap(112, 112, 112))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(149, 149, 149)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(jLabel39))
                    .addComponent(jLabel38))
                .addContainerGap(162, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabelBillede)
                .addGap(26, 26, 26)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(jLabel35)
                    .addComponent(lblantalKunder)
                    .addComponent(lblAntalProdukter))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17)
                    .addComponent(jLabel34))
                .addGap(18, 18, 18)
                .addComponent(jLabel36)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel37)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel38)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel39)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        ApplicationPane.addTab("Oversigt", jPanel1);

        SalgPanel.setPreferredSize(new java.awt.Dimension(435, 326));

        jLabel1.setText("Kunde ID");

        btnSalgFindSalg.setText("Find Salg");
        btnSalgFindSalg.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSalgFindSalgActionPerformed(evt);
            }
        });

        jLabel28.setText("Produkt ID");

        jLabel29.setText("Antal");

        jScrollPane2.setViewportView(lstBasket);

        btnBasketRemove.setText("Fjern");
        btnBasketRemove.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBasketRemoveActionPerformed(evt);
            }
        });

        btnBasketAdd.setText("Tilføj");
        btnBasketAdd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBasketAddActionPerformed(evt);
            }
        });

        btnSalgOpret.setText("Opret Salg");
        btnSalgOpret.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSalgOpretActionPerformed(evt);
            }
        });

        lblBasketTotal.setText("jLabel12");

        jLabel33.setText("kr");

        buttonGroup1.add(radioBetaltOK);
        radioBetaltOK.setText("Betalt");
        radioBetaltOK.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                radioBetaltOKActionPerformed(evt);
            }
        });

        buttonGroup1.add(radioBetaltNEJ);
        radioBetaltNEJ.setText("Ikke Betalt");
        radioBetaltNEJ.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                radioBetaltNEJActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout SalgPanelLayout = new javax.swing.GroupLayout(SalgPanel);
        SalgPanel.setLayout(SalgPanelLayout);
        SalgPanelLayout.setHorizontalGroup(
            SalgPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(SalgPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(SalgPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(SalgPanelLayout.createSequentialGroup()
                        .addComponent(radioBetaltNEJ)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(radioBetaltOK)
                        .addContainerGap())
                    .addGroup(SalgPanelLayout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(25, 25, 25)
                        .addComponent(txtSalgOpretKundeID, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())
                    .addGroup(SalgPanelLayout.createSequentialGroup()
                        .addComponent(lblSalgOpretResultat)
                        .addContainerGap(376, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, SalgPanelLayout.createSequentialGroup()
                        .addGroup(SalgPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, SalgPanelLayout.createSequentialGroup()
                                .addComponent(btnSalgOpret)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 114, Short.MAX_VALUE)
                                .addComponent(btnSalgFindSalg))
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE)
                            .addGroup(SalgPanelLayout.createSequentialGroup()
                                .addComponent(lblBasketTotal)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel33)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 160, Short.MAX_VALUE)
                                .addComponent(btnBasketRemove))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, SalgPanelLayout.createSequentialGroup()
                                .addComponent(jLabel28)
                                .addGap(18, 18, 18)
                                .addComponent(txtBasketProductID, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE)
                                .addGap(18, 18, 18)
                                .addComponent(jLabel29)
                                .addGap(16, 16, 16)
                                .addComponent(txtBasketAmount, javax.swing.GroupLayout.DEFAULT_SIZE, 42, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(btnBasketAdd)))
                        .addGap(104, 104, 104))))
        );
        SalgPanelLayout.setVerticalGroup(
            SalgPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(SalgPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(SalgPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(txtSalgOpretKundeID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(45, 45, 45)
                .addGroup(SalgPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtBasketProductID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtBasketAmount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnBasketAdd)
                    .addComponent(jLabel28)
                    .addComponent(jLabel29))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(SalgPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnBasketRemove)
                    .addComponent(jLabel33)
                    .addComponent(lblBasketTotal))
                .addGap(18, 18, 18)
                .addGroup(SalgPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(radioBetaltNEJ)
                    .addComponent(radioBetaltOK))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 52, Short.MAX_VALUE)
                .addComponent(lblSalgOpretResultat)
                .addGap(40, 40, 40)
                .addGroup(SalgPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnSalgOpret)
                    .addComponent(btnSalgFindSalg))
                .addContainerGap())
        );

        ApplicationPane.addTab("Salg", SalgPanel);

        ReservationPanel.setPreferredSize(new java.awt.Dimension(435, 326));

        btnReservationOpret.setText("Opret Reservation");
        btnReservationOpret.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnReservationOpretActionPerformed(evt);
            }
        });

        btnReservationVisAlleReservationer.setText("Find Reservation");
        btnReservationVisAlleReservationer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnReservationVisAlleReservationerActionPerformed(evt);
            }
        });

        jLabel23.setText("Job Beskrivelse");

        jLabel24.setText("Periode");

        jLabel25.setText("Dato");

        jLabel26.setText("Kunde ID");

        jLabel27.setText("Medarbejder ID");

        btnReservationVisAlleReservationer1.setText("Alle Reservationer");
        btnReservationVisAlleReservationer1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnReservationVisAlleReservationer1ActionPerformed(evt);
            }
        });

        jTextArea1.setColumns(20);
        jTextArea1.setRows(5);
        jScrollPane3.setViewportView(jTextArea1);

        javax.swing.GroupLayout ReservationPanelLayout = new javax.swing.GroupLayout(ReservationPanel);
        ReservationPanel.setLayout(ReservationPanelLayout);
        ReservationPanelLayout.setHorizontalGroup(
            ReservationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ReservationPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(ReservationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(ReservationPanelLayout.createSequentialGroup()
                        .addComponent(btnReservationOpret)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnReservationVisAlleReservationer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnReservationVisAlleReservationer1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(659, 659, 659))
                    .addGroup(ReservationPanelLayout.createSequentialGroup()
                        .addComponent(lblReserrvationStatus)
                        .addContainerGap(376, Short.MAX_VALUE))
                    .addGroup(ReservationPanelLayout.createSequentialGroup()
                        .addGroup(ReservationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel27)
                            .addComponent(jLabel26)
                            .addComponent(jLabel25)
                            .addComponent(jLabel24)
                            .addComponent(jLabel23))
                        .addGap(18, 18, 18)
                        .addGroup(ReservationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 239, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(ReservationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(txtReservationOpretKundeID, javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(txtReservationOpretMedarbejderID, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 70, Short.MAX_VALUE))
                            .addGroup(ReservationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(txtReservationOpretDato, javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(txtReservationOpretPeriode, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE)))
                        .addContainerGap(44, Short.MAX_VALUE))))
        );
        ReservationPanelLayout.setVerticalGroup(
            ReservationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ReservationPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(ReservationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel27)
                    .addComponent(txtReservationOpretMedarbejderID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(ReservationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel26)
                    .addComponent(txtReservationOpretKundeID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(ReservationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel25)
                    .addComponent(txtReservationOpretDato, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(ReservationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel24)
                    .addComponent(txtReservationOpretPeriode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(ReservationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(ReservationPanelLayout.createSequentialGroup()
                        .addGap(26, 26, 26)
                        .addComponent(jLabel23)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 149, Short.MAX_VALUE)
                        .addComponent(lblReserrvationStatus)
                        .addGap(48, 48, 48))
                    .addGroup(ReservationPanelLayout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addGroup(ReservationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnReservationOpret)
                    .addComponent(btnReservationVisAlleReservationer)
                    .addComponent(btnReservationVisAlleReservationer1))
                .addContainerGap())
        );

        ApplicationPane.addTab("Reservation", ReservationPanel);

        KundePanel.setPreferredSize(new java.awt.Dimension(435, 326));

        btnKundeUpdate.setText("Opdater");
        btnKundeUpdate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnKundeUpdateActionPerformed(evt);
            }
        });

        btnKundeDelete.setText("Slet");
        btnKundeDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnKundeDeleteActionPerformed(evt);
            }
        });

        UpdateKundeIDLabel.setText("Kunde ID");

        UpdateKundeNavnLabel.setText("Navn");

        UpdateKundeAdresseLabel.setText("Adresse");

        UpdateKundePostNrCityLabel.setText("Post Nr");

        UpdateKundePhoneNoLabel.setText("Telefor Nr");

        UpdateKundeEmailLabel.setText("E-Mail");

        jLabel6.setText("Rabat");

        btnKundeOpretNy.setText("Opret");
        btnKundeOpretNy.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnKundeOpretNyActionPerformed(evt);
            }
        });

        btnKundeHentID.setText("Hent");
        btnKundeHentID.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnKundeHentIDActionPerformed(evt);
            }
        });

        btnKundeAlleKunder.setText("Alle Kunder");
        btnKundeAlleKunder.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnKundeAlleKunderActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout KundePanelLayout = new javax.swing.GroupLayout(KundePanel);
        KundePanel.setLayout(KundePanelLayout);
        KundePanelLayout.setHorizontalGroup(
            KundePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(KundePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(KundePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(KundePanelLayout.createSequentialGroup()
                        .addGroup(KundePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(UpdateKundeIDLabel)
                            .addComponent(UpdateKundeNavnLabel)
                            .addComponent(UpdateKundeAdresseLabel)
                            .addComponent(UpdateKundePostNrCityLabel)
                            .addGroup(KundePanelLayout.createSequentialGroup()
                                .addGap(1, 1, 1)
                                .addGroup(KundePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel6)
                                    .addComponent(UpdateKundeEmailLabel)))
                            .addComponent(UpdateKundePhoneNoLabel))
                        .addGap(32, 32, 32)
                        .addGroup(KundePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtKundeUpdateEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(KundePanelLayout.createSequentialGroup()
                                .addComponent(txtKundeUpdateNavn, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(txtKundeUpdateEfterNavn, javax.swing.GroupLayout.DEFAULT_SIZE, 88, Short.MAX_VALUE))
                            .addComponent(txtKundeUpdateRabat, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(KundePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(txtKundeUpdateAdress, javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, KundePanelLayout.createSequentialGroup()
                                    .addComponent(txtKundeUpdatePostNr, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(18, 18, 18)
                                    .addComponent(txtKundeUpdateCity, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addComponent(txtKundeUpdatePhone, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(KundePanelLayout.createSequentialGroup()
                                .addComponent(txtKundeID, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(btnKundeHentID)))
                        .addGap(947, 947, 947))
                    .addGroup(KundePanelLayout.createSequentialGroup()
                        .addGap(4, 4, 4)
                        .addComponent(btnKundeOpretNy)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnKundeUpdate)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnKundeDelete)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnKundeAlleKunder)
                        .addContainerGap())
                    .addGroup(KundePanelLayout.createSequentialGroup()
                        .addComponent(jLabel31)
                        .addContainerGap(376, Short.MAX_VALUE))))
        );
        KundePanelLayout.setVerticalGroup(
            KundePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(KundePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(KundePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtKundeID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(UpdateKundeIDLabel)
                    .addComponent(btnKundeHentID))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(KundePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(KundePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(txtKundeUpdateNavn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(txtKundeUpdateEfterNavn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(UpdateKundeNavnLabel))
                    .addGroup(KundePanelLayout.createSequentialGroup()
                        .addGap(32, 32, 32)
                        .addGroup(KundePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtKundeUpdateAdress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(UpdateKundeAdresseLabel))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(KundePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtKundeUpdatePostNr, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtKundeUpdateCity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(UpdateKundePostNrCityLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(KundePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtKundeUpdatePhone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(UpdateKundePhoneNoLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(KundePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtKundeUpdateEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(UpdateKundeEmailLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(KundePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtKundeUpdateRabat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6))
                .addGap(18, 18, 18)
                .addComponent(jLabel31)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 136, Short.MAX_VALUE)
                .addGroup(KundePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnKundeOpretNy)
                    .addComponent(btnKundeUpdate)
                    .addComponent(btnKundeDelete)
                    .addComponent(btnKundeAlleKunder))
                .addContainerGap())
        );

        ApplicationPane.addTab("Kunde", KundePanel);

        ProduktPanel.setPreferredSize(new java.awt.Dimension(435, 326));

        jLabel2.setText("Produkt ID");

        jLabel3.setText("Type");

        jLabel4.setText("Pris");

        jLabel5.setText("Dimensioner");

        jLabel7.setText("Placering");

        jLabel8.setText("Minimum");

        jLabel9.setText("Antal På Lager");

        btnProduktOpret.setText("Opret");
        btnProduktOpret.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnProduktOpretActionPerformed(evt);
            }
        });

        btnProduktUpdate.setText("Opdater");
        btnProduktUpdate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnProduktUpdateActionPerformed(evt);
            }
        });

        btnProduktAlleVarer.setText("Alle Varer");
        btnProduktAlleVarer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnProduktAlleVarerActionPerformed(evt);
            }
        });

        jLabel10.setText("Maximum");

        jLabel11.setText("Levarandør Information");

        btnProduktSlet.setText("Slet");
        btnProduktSlet.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnProduktSletActionPerformed(evt);
            }
        });

        jButton5.setText("Hent");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout ProduktPanelLayout = new javax.swing.GroupLayout(ProduktPanel);
        ProduktPanel.setLayout(ProduktPanelLayout);
        ProduktPanelLayout.setHorizontalGroup(
            ProduktPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ProduktPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(ProduktPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(ProduktPanelLayout.createSequentialGroup()
                        .addGroup(ProduktPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel5)
                            .addGroup(ProduktPanelLayout.createSequentialGroup()
                                .addGap(1, 1, 1)
                                .addGroup(ProduktPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel7)
                                    .addComponent(jLabel8)))
                            .addComponent(jLabel4)
                            .addComponent(jLabel10)
                            .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel9)
                            .addComponent(jLabel2))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(ProduktPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(ProduktPanelLayout.createSequentialGroup()
                                .addGroup(ProduktPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(txtProduktUpdateType, javax.swing.GroupLayout.DEFAULT_SIZE, 129, Short.MAX_VALUE)
                                    .addComponent(txtproduktUpdateDimensioner, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtProduktUpdatePlacering)
                                    .addComponent(txtProduktUpdatePris, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(ProduktPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(ProduktPanelLayout.createSequentialGroup()
                                        .addGap(54, 54, 54)
                                        .addGroup(ProduktPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(lblKundeLeverandorInfo2)
                                            .addComponent(lblKundeLeverandorInfo)))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, ProduktPanelLayout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jLabel11)
                                        .addGap(9, 9, 9))))
                            .addGroup(ProduktPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(txtProduktUpdateAntalLager, javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(txtProduktUpdateMax, javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(txtProduktUpdateMin, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 70, Short.MAX_VALUE))
                            .addGroup(ProduktPanelLayout.createSequentialGroup()
                                .addComponent(txtProduktID, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jButton5)))
                        .addGap(114, 114, 114))
                    .addComponent(jLabel30)
                    .addGroup(ProduktPanelLayout.createSequentialGroup()
                        .addComponent(btnProduktOpret)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnProduktUpdate)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnProduktSlet)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnProduktAlleVarer)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        ProduktPanelLayout.setVerticalGroup(
            ProduktPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ProduktPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(ProduktPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtProduktID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2)
                    .addComponent(jButton5))
                .addGroup(ProduktPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(ProduktPanelLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(ProduktPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtProduktUpdateType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(ProduktPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtproduktUpdateDimensioner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel5))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(ProduktPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtProduktUpdatePris, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(ProduktPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtProduktUpdatePlacering, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel7))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(ProduktPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel8)
                            .addComponent(txtProduktUpdateMin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(ProduktPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtProduktUpdateMax, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel10))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(ProduktPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel9)
                            .addComponent(txtProduktUpdateAntalLager, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(ProduktPanelLayout.createSequentialGroup()
                        .addGap(38, 38, 38)
                        .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(lblKundeLeverandorInfo)
                        .addGap(18, 18, 18)
                        .addComponent(lblKundeLeverandorInfo2)))
                .addGap(32, 32, 32)
                .addComponent(jLabel30)
                .addGap(53, 53, 53)
                .addGroup(ProduktPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnProduktOpret)
                    .addComponent(btnProduktUpdate)
                    .addComponent(btnProduktSlet)
                    .addComponent(btnProduktAlleVarer))
                .addContainerGap())
        );

        ApplicationPane.addTab("Produkt", ProduktPanel);

        jLabel13.setText("Navn");

        btnLevernandorOpretNy.setText("Opret");
        btnLevernandorOpretNy.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLevernandorOpretNyActionPerformed(evt);
            }
        });

        btnLeverandorUpdate.setText("Opdaterer");
        btnLeverandorUpdate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLeverandorUpdateActionPerformed(evt);
            }
        });

        btnLeverandorDelete.setText("Slet");
        btnLeverandorDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLeverandorDeleteActionPerformed(evt);
            }
        });

        btnLeverandorAlleLev.setText("Alle Leverandør");
        btnLeverandorAlleLev.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLeverandorAlleLevActionPerformed(evt);
            }
        });

        txtLeverandorUpdateNavn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtLeverandorUpdateNavnActionPerformed(evt);
            }
        });

        jLabel14.setText("Adresse");

        jLabel15.setText("Telefon Nummer");

        jLabel16.setText("Leverandør ID");

        btnLeverandorHentID.setText("Hent");
        btnLeverandorHentID.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLeverandorHentIDActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout LeverandorPanelLayout = new javax.swing.GroupLayout(LeverandorPanel);
        LeverandorPanel.setLayout(LeverandorPanelLayout);
        LeverandorPanelLayout.setHorizontalGroup(
            LeverandorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(LeverandorPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(LeverandorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel32)
                    .addGroup(LeverandorPanelLayout.createSequentialGroup()
                        .addGroup(LeverandorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel16)
                            .addComponent(jLabel14)
                            .addComponent(jLabel15))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(LeverandorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtLeverandorUpdatePhone, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(LeverandorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addGroup(LeverandorPanelLayout.createSequentialGroup()
                                    .addComponent(txtLeverandorUpdateID, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(btnLeverandorHentID))
                                .addComponent(txtLeverandorUpdateNavn)
                                .addComponent(txtLeverandorUpdateAdresse, javax.swing.GroupLayout.PREFERRED_SIZE, 231, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addComponent(jLabel13)
                    .addGroup(LeverandorPanelLayout.createSequentialGroup()
                        .addComponent(btnLevernandorOpretNy)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnLeverandorUpdate)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnLeverandorDelete)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnLeverandorAlleLev)))
                .addContainerGap(44, Short.MAX_VALUE))
        );
        LeverandorPanelLayout.setVerticalGroup(
            LeverandorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(LeverandorPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(LeverandorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16)
                    .addComponent(txtLeverandorUpdateID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnLeverandorHentID))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(LeverandorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(txtLeverandorUpdateNavn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(LeverandorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtLeverandorUpdateAdresse, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(LeverandorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(txtLeverandorUpdatePhone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 217, Short.MAX_VALUE)
                .addComponent(jLabel32)
                .addGap(31, 31, 31)
                .addGroup(LeverandorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnLevernandorOpretNy)
                    .addComponent(btnLeverandorUpdate)
                    .addComponent(btnLeverandorDelete)
                    .addComponent(btnLeverandorAlleLev))
                .addContainerGap())
        );

        ApplicationPane.addTab("Leverandør", LeverandorPanel);

        jLabel18.setText("Medarbejder ID");

        jLabel19.setText("Navn");

        txtMedarbejderUpdateAnsat.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtMedarbejderUpdateAnsatActionPerformed(evt);
            }
        });

        jLabel20.setText("Adresse");

        jLabel21.setText("Løn");

        jLabel22.setText("Ansættelses Dato");

        btnMedarbejderHentID.setText("Hent");
        btnMedarbejderHentID.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMedarbejderHentIDActionPerformed(evt);
            }
        });

        btnMedarbejderTilfoj.setText("Opret");
        btnMedarbejderTilfoj.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMedarbejderTilfojActionPerformed(evt);
            }
        });

        btnMedarbejderUpdate.setText("Opdater");
        btnMedarbejderUpdate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMedarbejderUpdateActionPerformed(evt);
            }
        });

        btnMedarbejderAlleMedarbejder.setText("Alle Medarbejder");
        btnMedarbejderAlleMedarbejder.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMedarbejderAlleMedarbejderActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout MedarbejderPanelLayout = new javax.swing.GroupLayout(MedarbejderPanel);
        MedarbejderPanel.setLayout(MedarbejderPanelLayout);
        MedarbejderPanelLayout.setHorizontalGroup(
            MedarbejderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(MedarbejderPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(MedarbejderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(MedarbejderPanelLayout.createSequentialGroup()
                        .addGroup(MedarbejderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel18)
                            .addComponent(jLabel19)
                            .addComponent(jLabel20)
                            .addComponent(jLabel21)
                            .addComponent(jLabel22))
                        .addGap(18, 18, 18)
                        .addGroup(MedarbejderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(MedarbejderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addGroup(MedarbejderPanelLayout.createSequentialGroup()
                                    .addComponent(txtMedarbejderUpdateID, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(btnMedarbejderHentID))
                                .addComponent(txtMedarbejderUpdateAdresse)
                                .addComponent(txtMedarbejderUpdateNavn, javax.swing.GroupLayout.PREFERRED_SIZE, 232, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(txtMedarbejderUpdateLon, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(txtMedarbejderUpdateAnsat, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(MedarbejderPanelLayout.createSequentialGroup()
                        .addComponent(btnMedarbejderTilfoj)
                        .addGap(18, 18, 18)
                        .addComponent(btnMedarbejderUpdate)
                        .addGap(18, 18, 18)
                        .addComponent(btnMedarbejderAlleMedarbejder))
                    .addComponent(lblMedarbejder))
                .addContainerGap(40, Short.MAX_VALUE))
        );
        MedarbejderPanelLayout.setVerticalGroup(
            MedarbejderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(MedarbejderPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(MedarbejderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(txtMedarbejderUpdateID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnMedarbejderHentID))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(MedarbejderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel19)
                    .addComponent(txtMedarbejderUpdateNavn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(MedarbejderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel20)
                    .addComponent(txtMedarbejderUpdateAdresse, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(MedarbejderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtMedarbejderUpdateLon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel21))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(MedarbejderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtMedarbejderUpdateAnsat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel22))
                .addGap(30, 30, 30)
                .addComponent(lblMedarbejder)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 187, Short.MAX_VALUE)
                .addGroup(MedarbejderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnMedarbejderTilfoj)
                    .addComponent(btnMedarbejderUpdate)
                    .addComponent(btnMedarbejderAlleMedarbejder))
                .addContainerGap())
        );

        ApplicationPane.addTab("Medarbejder", MedarbejderPanel);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(ApplicationPane, javax.swing.GroupLayout.PREFERRED_SIZE, 391, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(ApplicationPane, javax.swing.GroupLayout.PREFERRED_SIZE, 437, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnKundeOpretNyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnKundeOpretNyActionPerformed

        
         opretKunde = new OpretKundeGUI();     }//GEN-LAST:event_btnKundeOpretNyActionPerformed

    private void btnProduktOpretActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProduktOpretActionPerformed
       
        opretProdukt = new OpretProdukt();
        
    }//GEN-LAST:event_btnProduktOpretActionPerformed

    private void btnLevernandorOpretNyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLevernandorOpretNyActionPerformed
        
        opretLever = new OpretLeverandor();
        
        
    }//GEN-LAST:event_btnLevernandorOpretNyActionPerformed

    private void btnMedarbejderTilfojActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMedarbejderTilfojActionPerformed

        opretMedarb = new OpretMedarbejder();
        
    }//GEN-LAST:event_btnMedarbejderTilfojActionPerformed

    private void btnReservationOpretActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnReservationOpretActionPerformed

       try{ 
        CtrReservation ctrReser = new CtrReservation();
        CtrEmployee ctrEmp  = new CtrEmployee();
        CtrCustomer ctrCus  = new CtrCustomer();
        
        Reservation resObj = new Reservation();
        ReservationRelation rrObj = new ReservationRelation();
        Employee emObj = new Employee();
        Customer cusObj = new Customer();
        
        
           
        cusObj.setId(Integer.valueOf(txtReservationOpretKundeID.getText()));
        emObj.setEmployeeID(Integer.valueOf(txtReservationOpretMedarbejderID.getText()));
 
        
        resObj.setDate(txtReservationOpretDato.getText());
        resObj.setTimePeriod(txtReservationOpretPeriode.getText());
        resObj.setJobType(jTextArea1.getText());
        

        resObj.setEmpID(emObj);
        resObj.setCustomerID(cusObj);

        rrObj.setReservation(resObj);
        rrObj.setEmployee(emObj);
        
        
        ctrReser.insertReservation(resObj);
        ctrReser.insertReservationRelation(rrObj);
        
  
        lblReserrvationStatus.setText("Reservation er Oprettet med følgende ID : ");
 
       }
       catch(Exception e)
       {
           JOptionPane.showMessageDialog(null, "Felterne må ikke være tomme", "Error", JOptionPane.ERROR_MESSAGE);
       }
     
        

    }//GEN-LAST:event_btnReservationOpretActionPerformed

    private void btnReservationVisAlleReservationerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnReservationVisAlleReservationerActionPerformed

            findReser = new FindReservation();
    }//GEN-LAST:event_btnReservationVisAlleReservationerActionPerformed

    private void btnKundeUpdateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnKundeUpdateActionPerformed
	
      //  try{
        CtrCustomer ctrC = new CtrCustomer();
        
	int cId = Integer.parseInt(txtKundeID.getText());
       
        String fname = txtKundeUpdateNavn.getText();
	String lname = txtKundeUpdateEfterNavn.getText();
        String address = txtKundeUpdateAdress.getText();
        int zipCode  = Integer.valueOf(txtKundeUpdatePostNr.getText());
        int phoneNo = Integer.valueOf(txtKundeUpdatePhone.getText());
        String city = txtKundeUpdateCity.getText();
        String email = txtKundeUpdateEmail.getText();
        double discount = Double.valueOf(txtKundeUpdateRabat.getText());       

        
        ctrC.updateCustomer(fname, lname, address, zipCode, phoneNo, city, email, discount, cId);
	     //   jLabel31.setText("Kunden blev Opdateret");
//        }
//        catch (Exception e)
//                {
//                    jLabel31.setText("Fejl, prøv igen.");
//                }
//        
        
    }//GEN-LAST:event_btnKundeUpdateActionPerformed

        private void btnKundeHentIDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnKundeHentIDActionPerformed

            try{
                
        CtrCustomer ctrC = new CtrCustomer();
	Customer c = ctrC.findById(Integer.valueOf(txtKundeID.getText()));
	txtKundeUpdateNavn.setText(c.getFname());
        txtKundeUpdateEfterNavn.setText(c.getLname());
        txtKundeUpdateAdress.setText(c.getAddress());
        txtKundeUpdatePostNr.setText(Integer.toString(c.getZipCode())); // Error here
        txtKundeUpdateCity.setText(c.getCity());
        txtKundeUpdatePhone.setText(Integer.toString(c.getPhoneNo()));
        txtKundeUpdateEmail.setText(c.getEmail());
        txtKundeUpdateRabat.setText(Double.toString(c.getDiscount()));
        jLabel31.setText("Kunden blev hentet");
                
            }
            catch (Exception e)
            {
                jLabel31.setText("Fejl, prøv igen.");
            }
        
    }//GEN-LAST:event_btnKundeHentIDActionPerformed

    private void btnKundeDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnKundeDeleteActionPerformed

        try{
            
       	CtrCustomer ctrC = new CtrCustomer();
	int id = Integer.parseInt(txtKundeID.getText());
	ctrC.deleteCustomer(id);
        jLabel31.setText("Kunden er Slettet");
        
        }        
        catch 
                ( Exception e)
                {
                    jLabel31.setText("Fejl, Prøv igen.");
                }
    }//GEN-LAST:event_btnKundeDeleteActionPerformed

    private void btnProduktSletActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProduktSletActionPerformed

        try{
        CtrProduct ctrP = new CtrProduct();
	int id = Integer.parseInt(txtProduktID.getText());
	ctrP.deleteProduct(id);
	
        jLabel30.setText("Produktet er slettet");
        
        }
        catch (Exception e)
        {
            jLabel30.setText("Fejl, prøv igen.");
        }
    }//GEN-LAST:event_btnProduktSletActionPerformed

    private void btnLeverandorHentIDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLeverandorHentIDActionPerformed
        try{
            
        CtrSupplier ctrS = new CtrSupplier();
        CtrProduct ctrP = new CtrProduct();
        Supplier sup = ctrS.findSupplier(Integer.valueOf(txtLeverandorUpdateID.getText()));
        txtLeverandorUpdateNavn.setText(sup.getName());
        txtLeverandorUpdateAdresse.setText(sup.getAddress());
        txtLeverandorUpdatePhone.setText(Integer.toString(sup.getPhoneNo()));
        }
        catch (Exception e)
        {
            jLabel32.setText("Ugyldig id");
        }
        
    }//GEN-LAST:event_btnLeverandorHentIDActionPerformed

    private void btnProduktAlleVarerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProduktAlleVarerActionPerformed

        alleProd = new AlleProdukter();
        
    }//GEN-LAST:event_btnProduktAlleVarerActionPerformed

    private void btnLeverandorUpdateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLeverandorUpdateActionPerformed
        
        try{
            
        CtrSupplier ctrS = new CtrSupplier();
	int supplierID = Integer.parseInt(txtLeverandorUpdateID.getText());
        String name = txtLeverandorUpdateNavn.getText();
	String address = txtLeverandorUpdateAdresse.getText();
        int phoneNo = Integer.valueOf(txtLeverandorUpdatePhone.getText());
             
        ctrS.updateSupplier(supplierID, name, address, phoneNo);
        jLabel32.setText("Leverandør opdateret");
        }        
        catch 
                ( Exception e)
                {
                    jLabel32.setText("Fejl, Prøv igen.");
                }


    }//GEN-LAST:event_btnLeverandorUpdateActionPerformed

    private void btnLeverandorDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLeverandorDeleteActionPerformed
        
        try{
            
       	CtrSupplier ctrS = new CtrSupplier();
	int supplierID = Integer.parseInt(txtLeverandorUpdateID.getText());
	ctrS.deleteSupplier(supplierID);
        jLabel32.setText("Leverandør slettet");
        }
        catch 
                ( Exception e)
                {
                    jLabel32.setText("Forkert leverandør id");
                }
        
    }//GEN-LAST:event_btnLeverandorDeleteActionPerformed

    private void btnLeverandorAlleLevActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLeverandorAlleLevActionPerformed

        allelever = new AlleLeverandor();
        
    }//GEN-LAST:event_btnLeverandorAlleLevActionPerformed


    private void btnKundeAlleKunderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnKundeAlleKunderActionPerformed

        allekunder = new AlleKunderGUI();
        
    }//GEN-LAST:event_btnKundeAlleKunderActionPerformed

    private void txtLeverandorUpdateNavnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtLeverandorUpdateNavnActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtLeverandorUpdateNavnActionPerformed

    private void btnMedarbejderHentIDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMedarbejderHentIDActionPerformed

        
        CtrEmployee ctrE = new CtrEmployee();
        Employee emp = ctrE.findEmployeebyID(Integer.parseInt(txtMedarbejderUpdateID.getText()));
        
        txtMedarbejderUpdateNavn.setText(emp.getName());
        txtMedarbejderUpdateAdresse.setText(emp.getAddress());
        txtMedarbejderUpdateLon.setText(Double.toString(emp.getSalary()));
        txtMedarbejderUpdateAnsat.setText(emp.getStartDate());
      
        

    }//GEN-LAST:event_btnMedarbejderHentIDActionPerformed

    private void btnMedarbejderAlleMedarbejderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMedarbejderAlleMedarbejderActionPerformed
        
        alleMedarb = new AlleMedarbejder();
        
    }//GEN-LAST:event_btnMedarbejderAlleMedarbejderActionPerformed

    private void btnMedarbejderUpdateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMedarbejderUpdateActionPerformed

        
        CtrEmployee ctrEemp = new CtrEmployee();
	int eId = Integer.parseInt(txtMedarbejderUpdateID.getText());
        
        String name = txtMedarbejderUpdateNavn.getText();
	String address = txtMedarbejderUpdateAdresse.getText();
        Double salary = Double.parseDouble(txtMedarbejderUpdateLon.getText());
     	String startDate = txtMedarbejderUpdateAnsat.getText();

        ctrEemp.updateEmp(eId, name, address, salary, startDate);
        lblMedarbejder.setText("Medarbejder er opdateret");
   
    }//GEN-LAST:event_btnMedarbejderUpdateActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed

         //     try{
	CtrProduct ctrP = new CtrProduct();
	CtrSupplier ctrS = new CtrSupplier();
	
        Product p = ctrP.findByID(Integer.valueOf(txtProduktID.getText()));
        Supplier s = ctrS.findSupplier(p.getSupplierID().getSupID());
       
        txtProduktUpdateType.setText(p.getType());
	txtproduktUpdateDimensioner.setText(Double.toString(p.getDimensions()));
	txtProduktUpdatePris.setText(Double.toString(p.getPrice()));
	txtProduktUpdatePlacering.setText(p.getPlacement());
        txtProduktUpdateMin.setText(Integer.toString(p.getMinStock()));
        txtProduktUpdateMax.setText(Integer.toString(p.getMaxStock()));
        txtProduktUpdateAntalLager.setText(Integer.toString(p.getCurrentStock()));
        
        jLabel30.setText(String.valueOf(p.getSupplierID().getSupID()));
        
        lblKundeLeverandorInfo.setText(s.getName());
        lblKundeLeverandorInfo2.setText(Integer.toString(s.getPhoneNo()));
       
        
       // jLabel30.setText("Produktet er Hentet");
     
//    }
//        catch (Exception e)
//        {
//            jLabel30.setText("Fejl, prøv igen.");
//        }
//      
    }//GEN-LAST:event_jButton5ActionPerformed

    private void btnSalgOpretActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalgOpretActionPerformed

        opretSalg();
   
    }//GEN-LAST:event_btnSalgOpretActionPerformed

    private void btnBasketAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBasketAddActionPerformed

            Product product = ctrProduct.findByID(Integer.valueOf(txtBasketProductID.getText()));
            String amount = txtBasketAmount.getText();
            
            double calculatedPrice = product.getPrice() * Double.valueOf(amount) / 100 * ctrCustomer.findById(Integer.valueOf(txtSalgOpretKundeID.getText())).getDiscount();

            listSalesLine.add(new SalesLine(null, product, Integer.valueOf(amount)));
            listModel.addElement(amount + " x " + product.getType() + " = " + String.valueOf(calculatedPrice));
            
            lblBasketTotal.setText(String.valueOf(Double.valueOf(lblBasketTotal.getText()) + calculatedPrice));
            lblSalgOpretResultat.setText("Et produkt blev tilføjet.");
        
       
//        try
//        {
//        
//        {
//        catch(Exception e)
//        {
//            lblSalgOpretResultat.setText("Der opstod en fejl: " + e.getMessage());
//        }
               
    }//GEN-LAST:event_btnBasketAddActionPerformed

    private void btnBasketRemoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBasketRemoveActionPerformed
    int basketSelected = lstBasket.getSelectedIndex();

    if (basketSelected != -1) 
    {
        String amount = txtBasketAmount.getText();
        SalesLine selectedSalesLine = listSalesLine.get(basketSelected);
        double calculatedPrice = selectedSalesLine.getProduct().getPrice() * Double.valueOf(amount) / 100 * ctrCustomer.findById(Integer.valueOf(txtSalgOpretKundeID.getText())).getDiscount();
        
        lblBasketTotal.setText(String.valueOf(Double.valueOf(lblBasketTotal.getText()) - calculatedPrice));

        listSalesLine.remove(basketSelected);
        listModel.remove(basketSelected);

        lblSalgOpretResultat.setText("Et produkt blev fjernet.");
    }
    else
    {
        lblSalgOpretResultat.setText("Du bliver nød til at vælge et produkt fra listen, før at du kan slette det.");
    }
        
        //        try 
//        {
//            
//        } 
//        catch (Exception e) 
//        {
//            lblSalgOpretResultat.setText("Der opstod en fejl: " + e.getMessage());
//        }
    }//GEN-LAST:event_btnBasketRemoveActionPerformed

    private void btnReservationVisAlleReservationer1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnReservationVisAlleReservationer1ActionPerformed
       
        alleReser = new AlleReservationer();
        
    }//GEN-LAST:event_btnReservationVisAlleReservationer1ActionPerformed

    private void radioBetaltOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioBetaltOKActionPerformed

       sale1 = new Sale();  
       if(radioBetaltOK.isSelected())
        {
           sale1.setStatus(true);
        }

    }//GEN-LAST:event_radioBetaltOKActionPerformed

    private void radioBetaltNEJActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioBetaltNEJActionPerformed

       sale1 = new Sale();  
       if(radioBetaltNEJ.isSelected())
        {
           sale1.setStatus(false);
        }
        
    }//GEN-LAST:event_radioBetaltNEJActionPerformed

private void btnProduktUpdateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProduktUpdateActionPerformed
    CtrProduct ctrprod = new CtrProduct();
        
        int productID = Integer.parseInt(txtProduktID.getText());
      
        
        String type = txtProduktUpdateType.getText();
        Double price  = Double.valueOf(txtProduktUpdatePris.getText());
        Double dimensions  = Double.valueOf(txtproduktUpdateDimensioner.getText());
        String placement = txtProduktUpdatePlacering.getText();
        int minStock = Integer.valueOf(txtProduktUpdateMin.getText());
        int maxStock = Integer.valueOf(txtProduktUpdateMax.getText());
        int currentStock = Integer.valueOf(txtProduktUpdateAntalLager.getText());
        
        
        ctrprod.updateProduct(type, price, dimensions, placement, minStock, maxStock, currentStock, productID);
}//GEN-LAST:event_btnProduktUpdateActionPerformed

    private void btnSalgFindSalgActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalgFindSalgActionPerformed

        alleSalg = new FindSalg();
        
    }//GEN-LAST:event_btnSalgFindSalgActionPerformed

    private void jLabel36MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel36MouseClicked

        
        String str = "www.jobsmobilsav.dk";
        jLabel36.setText(str);
    }//GEN-LAST:event_jLabel36MouseClicked

    private void txtMedarbejderUpdateAnsatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtMedarbejderUpdateAnsatActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtMedarbejderUpdateAnsatActionPerformed

        
    
    private void saleClear()
    {
        txtBasketAmount.setText(null);
        txtBasketProductID.setText(null);
        txtSalgOpretKundeID.setText(null);
        
        lblBasketTotal.setText("0");
        
        listSalesLine = new ArrayList<SalesLine>();
        lstBasket.removeAll();
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            //BEST ACTIV//
            //UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");      
        //UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
	// GOD NOK 
          // UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
       
            // ORGINAL //
//            try {
//            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
//                if ("Nimbus".equals(info.getName())) {
//                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
//                    break;
//      }
//    }
        
        } 
        catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new MainGUI().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTabbedPane ApplicationPane;
    private javax.swing.JPanel KundePanel;
    private javax.swing.JPanel LeverandorPanel;
    private javax.swing.JPanel MedarbejderPanel;
    private javax.swing.JPanel ProduktPanel;
    private javax.swing.JPanel ReservationPanel;
    private javax.swing.JPanel SalgPanel;
    private javax.swing.JLabel UpdateKundeAdresseLabel;
    private javax.swing.JLabel UpdateKundeEmailLabel;
    private javax.swing.JLabel UpdateKundeIDLabel;
    private javax.swing.JLabel UpdateKundeNavnLabel;
    private javax.swing.JLabel UpdateKundePhoneNoLabel;
    private javax.swing.JLabel UpdateKundePostNrCityLabel;
    private javax.swing.JButton btnBasketAdd;
    private javax.swing.JButton btnBasketRemove;
    private javax.swing.JButton btnKundeAlleKunder;
    private javax.swing.JButton btnKundeDelete;
    private javax.swing.JButton btnKundeHentID;
    private javax.swing.JButton btnKundeOpretNy;
    private javax.swing.JButton btnKundeUpdate;
    private javax.swing.JButton btnLeverandorAlleLev;
    private javax.swing.JButton btnLeverandorDelete;
    private javax.swing.JButton btnLeverandorHentID;
    private javax.swing.JButton btnLeverandorUpdate;
    private javax.swing.JButton btnLevernandorOpretNy;
    private javax.swing.JButton btnMedarbejderAlleMedarbejder;
    private javax.swing.JButton btnMedarbejderHentID;
    private javax.swing.JButton btnMedarbejderTilfoj;
    private javax.swing.JButton btnMedarbejderUpdate;
    private javax.swing.JButton btnProduktAlleVarer;
    private javax.swing.JButton btnProduktOpret;
    private javax.swing.JButton btnProduktSlet;
    private javax.swing.JButton btnProduktUpdate;
    private javax.swing.JButton btnReservationOpret;
    private javax.swing.JButton btnReservationVisAlleReservationer;
    private javax.swing.JButton btnReservationVisAlleReservationer1;
    private javax.swing.JButton btnSalgFindSalg;
    private javax.swing.JButton btnSalgOpret;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JButton jButton5;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabelBillede;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTextArea jTextArea1;
    private javax.swing.JLabel lblAntalProdukter;
    private javax.swing.JLabel lblBasketTotal;
    private javax.swing.JLabel lblKundeLeverandorInfo;
    private javax.swing.JLabel lblKundeLeverandorInfo2;
    private javax.swing.JLabel lblMedarbejder;
    private javax.swing.JLabel lblReserrvationStatus;
    private javax.swing.JLabel lblSalgOpretResultat;
    private javax.swing.JLabel lblantalKunder;
    private javax.swing.JList lstBasket;
    private javax.swing.JRadioButton radioBetaltNEJ;
    private javax.swing.JRadioButton radioBetaltOK;
    private javax.swing.JTextField txtBasketAmount;
    private javax.swing.JTextField txtBasketProductID;
    private javax.swing.JTextField txtKundeID;
    private javax.swing.JTextField txtKundeUpdateAdress;
    private javax.swing.JTextField txtKundeUpdateCity;
    private javax.swing.JTextField txtKundeUpdateEfterNavn;
    private javax.swing.JTextField txtKundeUpdateEmail;
    private javax.swing.JTextField txtKundeUpdateNavn;
    private javax.swing.JTextField txtKundeUpdatePhone;
    private javax.swing.JTextField txtKundeUpdatePostNr;
    private javax.swing.JTextField txtKundeUpdateRabat;
    private javax.swing.JTextField txtLeverandorUpdateAdresse;
    private javax.swing.JTextField txtLeverandorUpdateID;
    private javax.swing.JTextField txtLeverandorUpdateNavn;
    private javax.swing.JTextField txtLeverandorUpdatePhone;
    private javax.swing.JTextField txtMedarbejderUpdateAdresse;
    private javax.swing.JTextField txtMedarbejderUpdateAnsat;
    private javax.swing.JTextField txtMedarbejderUpdateID;
    private javax.swing.JTextField txtMedarbejderUpdateLon;
    private javax.swing.JTextField txtMedarbejderUpdateNavn;
    private javax.swing.JTextField txtProduktID;
    private javax.swing.JTextField txtProduktUpdateAntalLager;
    private javax.swing.JTextField txtProduktUpdateMax;
    private javax.swing.JTextField txtProduktUpdateMin;
    private javax.swing.JTextField txtProduktUpdatePlacering;
    private javax.swing.JTextField txtProduktUpdatePris;
    private javax.swing.JTextField txtProduktUpdateType;
    private javax.swing.JTextField txtReservationOpretDato;
    private javax.swing.JTextField txtReservationOpretKundeID;
    private javax.swing.JTextField txtReservationOpretMedarbejderID;
    private javax.swing.JTextField txtReservationOpretPeriode;
    private javax.swing.JTextField txtSalgOpretKundeID;
    private javax.swing.JTextField txtproduktUpdateDimensioner;
    // End of variables declaration//GEN-END:variables

   private Sale sale1;
   
   private void opretSalg()
   {
       try{
           // Dato bliver sat op
        Date date = new Date();
        // Kunden bliver fundet ved hjælp af textbox
        Customer customer = ctrCustomer.findById(Integer.valueOf(txtSalgOpretKundeID.getText()));
        // Salget bliver gemt i databasen (fejl: jeg tror ikke at den bliver oprettet i databasen)
        CtrSale ctrSal = new CtrSale();
        CtrCustomer ctrCus = new CtrCustomer();
        
        Customer cusObj = new Customer();
        Sale saleObj = new Sale();
        SalesLine salslineObj = new SalesLine();
               
        saleObj.setCustomer(customer);
        saleObj.setDate(String.valueOf(date));
        
        saleObj.setStatus(sale1.getStatus());
        
        saleObj.setTotalPrice(Double.valueOf(lblBasketTotal.getText()));
               
        // Finder det nyeste salg i databasen, som skal bruges når salgslinjerne skal oprettes (fejl: Arraylist er tom)
        
        
        
        // Sørger for at alle salgslinjerne får det rigtige salgs id
        
        for (int i = 0; i < listSalesLine.size(); i++) 
        {
            listSalesLine.get(i).setSale(saleObj);
        }
        
        // Gemmer alle salgslinjerne i databasen
        
        
        ctrSal.insertSale(saleObj);
        ctrSalesLine.insertSalesLines(listSalesLine);
        

        lblSalgOpretResultat.setText("Salget blev gemt med følgende id: " + ctrSale.MAXID());
       }
       catch (Exception e)
       {
           JOptionPane.showMessageDialog(null, "Felterne må ikke være tomme", "Error", JOptionPane.ERROR_MESSAGE);
       }
        
   }
}
